﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>用户注册</title>
    <link href="../WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="../WF/Scripts/bootstrap/css/font-awesome.css" rel="stylesheet" />
    <link href="../WF/Style/skin/css/login.css" rel="stylesheet" type="text/css" />
    <link href="../WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="../WF/Style/skin/css/login.css" rel="stylesheet" type="text/css" />
    <link href="../WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <script src="../WF/Comm/JS/validation.js"></script>
    <script src="../WF/Style//skin/layui/layui.js" type="text/javascript"></script>
    <script src="../WF/Scripts/jquery/jquery.min.js" type="text/javascript"></script>
    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../WF/Scripts/QueryString.js"></script>
    <script type="text/javascript" src="../WF/Scripts/config.js"></script>
    <script type="text/javascript" src="../WF/Comm/Gener.js"></script>
</head>
<body>
    <form id="cc" enctype="application/x-www-form-urlencoded">
        <center>
            <div id="Msg"></div>
            <table>
                <tr>
                    <th colspan="3">用户注册</th>
                </tr>
                <tr>
                    <td>用户名</td>
                    <td><input type="text" id="TB_No" /> </td>
                    <td>请输入手机号,工号,或者拼音或下划线组合的用户名.</td>
                </tr>

                <tr>
                    <td>登录密码</td>
                    <td><input type="text" id="TB_PW" /> </td>
                    <td><font color="red">*</font></td>
                </tr>

                <tr>
                    <td>重复密码</td>
                    <td><input type="text" id="TB_PW1" /> </td>
                    <td><font color="red">*</font></td>
                </tr>

                <tr>
                    <td>姓名</td>
                    <td><input type="text" id="TB_Name" /> </td>
                    <td><font color="red">*</font></td>
                </tr>
                <tr>
                    <td>隶属部门</td>
                    <td><select id="DDL_FK_Dept"></select></td>
                    <td><font color="red">*</font></td>
                </tr>

                <tr>
                    <td>邮件</td>
                    <td><input type="text" id="TB_Email" /> </td>
                    <td></td>
                </tr>

                <tr>
                    <td></td>
                    <td><input type="button" id="Btn_Save" value="注册" onclick="Save()" /> </td>
                    <td></td>
                </tr>
            </table>
        </center>
    </form>

    <script type="text/javascript">

        $(function () {

            $("#Msg").html("正在加载请稍候...");

            var handler = new HttpHandler("BP.GPM.HttpHandler");
            var data = handler.DoMethodReturnString("RegUser_Init");
            if (data.indexOf('err@') == 0) {
                $("#Msg").html(data);
                return;
            }
            $("#Msg").html("");

            data = eval(data); //转成Json.
            //绑定部门.
            GenerBindDDL("DDL_FK_Dept", data, "No", "Name");

        });

        function Save() {

            if ($("#TB_PW").val() != $("#TB_PW1").val()) {
                alert('两次密码不一致.');
                return;
            }

            var handler = new HttpHandler("BP.GPM.HttpHandler");
            handler.AddFormData(); //复制表单数据.
            var data = handler.DoMethodReturnString("RegUser_Submit");

            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }

            alert(data);
            window.Back();

            //window.location.href = 'Login.htm';
        }

    </script>
</body>
</html>